package model;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

public class Field {

	private int id;
	@NotNull(message="字段名称不能为空！")
	@Size(min=1,max=50,message="字段名称长度应在1-50之间！")
	private String fieldName;
	@NotNull(message="表名不能为空！")
	private int tId;
	@NotNull(message="字段类型不能为空！")
	private String type;
//	@NotNull(message="时间戳字段不能为空！")
//	private String createTime;
//	@NotNull(message="位置或机器号字段不能为空！")
//	private String location;
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getFieldName() {
		return fieldName;
	}
	public void setFieldName(String fieldName) {
		this.fieldName = fieldName;
	}
	public int gettId() {
		return tId;
	}
	public void settId(int tId) {
		this.tId = tId;
	}
	
	
	
	/*
	public String getLocation() {
		return location;
	}
	public void setLocation(String location) {
		this.location = location;
	}
	*/
	
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	
	public Field(String fieldName, int tId, String createTime, String location,String type) {
		this.fieldName = fieldName;
		this.tId = tId;
		this.type = type;
	}
	@Override
	public String toString() {
		return "Field [id=" + id + ", fieldName=" + fieldName + ", tId=" + tId
				+ ", type=" + type + "]";
	}
	public Field() {
	}
}
